package com.ysh.spring.event.listener;

import com.ysh.spring.event.pojo.HZ;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * 袁胜虎 on 2022/8/29 19:08
 */
@Component
public class YS {
    @EventListener
    @Async
    public void onEvent(HZ hz){
        System.err.println("医院收到了通知,在"+hz.getAddress()+"这个地方发生了火灾"+Thread.currentThread().getName());
    }
}
